#!/bin/bash 
INVIGILATOR_PATH=`dirname "$0"`

$INVIGILATOR_PATH/frontend.py & 

frontend_id="$!" 
trap "kill $frontend_id; frontend_id=0" SIGINT SIGTERM 

while [ $frontend_id -ne 0 ] 
do 
	$INVIGILATOR_PATH/trigger.py & 
	$INVIGILATOR_PATH/poll.py & 
	
	for i in `seq 1 15`;
	do
		if [ $frontend_id -eq 0 ] ; then exit; fi
		sleep 1
	done
done 
